package com.xingxue.controller;

import com.xingxue.service.ModuleService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.GetMapping;

import javax.servlet.http.HttpServletRequest;

@Controller
@Slf4j
public class LoginController {

    @Autowired
    private ModuleService moduleService;

    // 登录页面
    @GetMapping(path = "/login")
    public void login(HttpServletRequest request) {
        request.getServletContext().setAttribute("moduleService", moduleService);
    }

    // 首页面
    @GetMapping(path = {"/", "/index"})
    public String index() {
        return "index";
    }

}
